<template>
  <el-divider v-bind="dividersetting" />
</template>

<script lang="ts">
import { ElDivider } from 'element-plus'
// 添加导出组件的语句
export default {
  components: {
    ElDivider,
  },
  props: ['dividersetting'],
}

/**
 * 按钮组件
 *
 * @param {string} _direction 分割线方向
 * @param {string} _borderStyle 分割线样式
 * @param {string} _contentPosition 分割线内容位置
 * @param {string} _color 分割线颜色
 * @param {string} _bgColor 分割线背景颜色
 * @param {boolean} _disabled 是否禁用
 * @param {string | Component} _tag 按钮标签
 * @param {Record<string, (event: Event) => void>} _buttonEvents 按钮事件
 */
export class Dividersetting {
  direction: string
  borderStyle: string
  contentPosition: string
  constructor(settings?: DividerSettingsType) {
    this.direction = settings?.direction
    this.borderStyle = settings?.borderStyle
    this.contentPosition = settings?.contentPosition
  }

  /**
   * 获取按钮所有属性
   * @returns {Object} 按钮属性对象
   */
  getAttributes(): DividerSettingsType {
    return {
      direction: this.direction,
      borderStyle: this.borderStyle,
      contentPosition: this.contentPosition,
    }
  }
}
</script>
